//
//  ShopListcommodity.m
//  __PRODUCTNAME__
//
//  Created by LL.F on 16/09/09
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "ShopListcommodity.h"
#import "ShopVisualcodelist.h"
#import "ShopImagelist.h"
#import "ShopCommoditytype.h"

@implementation ShopListcommodity

+ (NSDictionary *)objectClassInArray{
    return @{@"visualCodeList" : [ShopVisualcodelist class], @"imageList" : [ShopImagelist class]};
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
    if ([key isEqualToString:@"id"]) {
        _id_Data = [value integerValue];
    }
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    
    [super setValue:value forKey:key];
    if ( [key isEqualToString:@"commodityType"]) {
        _commodityType = [ShopCommoditytype modelWithDic:value];
    }
    if ([key isEqualToString:@"visualCodeList"]) {
        NSMutableArray<ShopVisualcodelist *>  *codelistArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ShopVisualcodelist *data = [ShopVisualcodelist modelWithDic:dic];
            [codelistArray addObject:data];
        }
        _visualCodeList = codelistArray;
    }
    if ([key isEqualToString:@"imageList"]) {
        NSMutableArray<ShopImagelist *>  *imagelistArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ShopImagelist *data = [ShopImagelist modelWithDic:dic];
            [imagelistArray addObject:data];
        }
        _imageList = imagelistArray;
    }
}
@end
